package com.shooker.proxy.jdk;

import com.shooker.proxy.jdk.service.JdkProxyService;
import com.shooker.proxy.jdk.service.impl.JdkProxyServiceImpl;

import java.lang.reflect.Proxy;

/**
 * @Description
 * @Author zhousl
 * @Date 2023/4/23 20:32
 */
public class JdkProxyClient {

    public static void main(String[] args){
        JdkProxyService jdkProxyService = (JdkProxyService)Proxy.newProxyInstance(
                JdkProxyServiceImpl.class.getClassLoader(),
                JdkProxyServiceImpl.class.getInterfaces(),
                new JdkProxy(new JdkProxyServiceImpl()));
        System.out.println(jdkProxyService);
        jdkProxyService.jdkProxy();
    }
}
